package application.common.render;

import com.jfinal.kit.StrKit;

import application.common.model.StoreLog;
import javafx.beans.property.SimpleStringProperty;

public final class StoreLogProperty {

	private final SimpleStringProperty id = new SimpleStringProperty();
	private final SimpleStringProperty cabinetId = new SimpleStringProperty();
	private final SimpleStringProperty storeId = new SimpleStringProperty();
	private final SimpleStringProperty status = new SimpleStringProperty();
	private final SimpleStringProperty userId = new SimpleStringProperty();
	private final SimpleStringProperty createTime = new SimpleStringProperty();
	
	private final SimpleStringProperty userName = new SimpleStringProperty();
	private final SimpleStringProperty cabinetName = new SimpleStringProperty();
	private final SimpleStringProperty statusName = new SimpleStringProperty();
	
	public StoreLogProperty(StoreLog log) {
		id.set(log.getId());
		cabinetId.set(log.getCabinetId());
		storeId.set(log.getStoreId());
		status.set(log.getStatus());
		userId.set(log.getUserId());
		createTime.set(log.getCreateTime());
		userName.set(log.getCreateTime());
		cabinetName.set(log.getCreateTime());
		if(StrKit.equals("0", log.getStatus())){
			statusName.set("存入");
		}
		else if(StrKit.equals("1", log.getStatus())){
			statusName.set("续存");
		}
		else if(StrKit.equals("2", log.getStatus())){
			statusName.set("提取");
		}else {
			statusName.set( log.getStatus());
		}
		
	}

	public String getId() {
		return id.get();
	}


}
